gallerier
library(gallerier)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(hashids)
images <- data.frame(src = list.files('www/img')) %>%
tidyr::separate(col = 'src', c('txt', 'date', 'time', 'msec'), sep = '_|\\.', remove = FALSE) %>%
rowwise() %>%
mutate(date = lubridate::ymd(date),
key = hashids::encode(1e3 + as.integer(msec), hashid_settings(salt = 'this is my salt')))
## Warning: Expected 4 pieces. Additional pieces discarded in 20 rows [1, 2, 3, 4,
## 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20].
## simple lightbox
images[1:9,] %>%
mutate(src = paste0('www/img/', src)) %>%
lightbox_gallery(., 'gallery',
display = TRUE)
## Warning in dir.create("www"): 'www' already exists